#ifndef Q_PCL_PLUGIN_ALIGNMENTDIALOG_HEADER
#define Q_PCL_PLUGIN_ALIGNMENTDIALOG_HEADER


#include <Alignment.h>
#include <ui_AlignmentDialog.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/visualization/pcl_visualizer.h>


 #include <QMessageBox>
class AlignmentDialog : public QDialog, public Ui::AlignmentDialog
{
    Q_OBJECT
public:
    AlignmentDialog(Alignment* a,QWidget* parent=0);
	~AlignmentDialog();

private slots:
	void loadSourceCloud();
	void loadTargetCloud();

	void removeTgtPoint();
	void removeSrcPoint();

	void nPointAlign();

signals:
	void tgtPointPicked(size_t id, float x,float y,float z);
	void srcPointPicked(size_t id, float x,float y,float z);

public:



	//Viewers
	boost::shared_ptr<pcl::visualization::PCLVisualizer> tgt_viewer;
	boost::shared_ptr<pcl::visualization::PCLVisualizer> src_viewer;

private:
	Alignment* alignment;
	//Point-Picking Callbacks
	void tgt_pp_callback (const pcl::visualization::PointPickingEvent &event,void*viewer_void);
	void src_pp_callback (const pcl::visualization::PointPickingEvent &event,void*viewer_void);

	void populateListView(int);
};

#endif // Q_PCL_PLUGIN_ALIGNMENTDIALOG_HEADER
